<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<script type="text/javascript">
$(document).ready(function(){
	//只有IE浏览器才会正确显示
	$("#classEdit,#classDelete").hover(function(){
		var x1=$("#classCode").val();
		$("#classEdit").attr("href","ClassInfoServlet.do?command=findById&classCode="+x1);
		$("#classDelete").attr("href","ClassInfoServlet.do?command=delete&classCode="+x1);
	});
});
</script>
<form id="pagerForm" method="post" action="ClassInfoServlet.do?command=findByNameAndCode">
	<input type="hidden" name="pageNum" value="1" />
	<input type="hidden" name="numPerPage" value="${param.numPerPage==null?10:param.numPerPage}" />
	
	<input type="hidden" name="classCode" value="${param.classCode}"/>
	<input type="hidden" name="className" value="${param.className}"/>
	<input type="hidden" name="deptCode"   value="${param.deptCode}">
</form>
<div class="page">
	<div class="pageHeader" style="margin-bottom: 0">
		<form onsubmit="return navTabSearch(this);" action="ClassInfoServlet.do?command=findByNameAndCode" method="post">
		  <div class="searchBar">
			<div class="searchContent" layoutH="650">
				   <span><select name="deptCode">
				           <option value="" ${param.deptCode!=null ? "selected":""}>所属系部</option>
				        <c:forEach items="${deptInfos}" var="deptInfo">
					       <option value="${deptInfo.deptCode}" ${param.deptCode==deptInfo.deptCode?"selected":""}>${deptInfo.deptName}</option>
					    </c:forEach>
				   </select>
		           </span>
			    <span>班级代码：<input type="text" name="classCode" id="classCode" value="${param.classCode}"/></span>
				<span>班级名称：<input type="text" name="className" value="${param.className}" id="className"/></span>
				<input type="hidden" name="pageNum" value="1" />
				<span class="buttonActive"><span class="buttonContent"><button type="submit">检索</button></span></span>	    
	        </div>
	        
	      </div>
		</form>
	</div>
	<div class="pageContent">
		<div class="panelBar">
			<ul class="toolBar">
				<li><a id="classAdd" class="add" href="ClassInfoServlet.do?command=add" target="navTab" title="添加班级" rel="ClassInfoEdit"><span>添加</span></a></li>
				<li><a id="classDelete" class="delete" href="ClassInfoServlet.do?command=delete" target="navTabTodo" title="确定要删除吗?"><span>删除</span></a></li>
				<li><a id="classEdit" class="edit" href="ClassInfoServlet.do?command=findById" target="navTab" title="修改班级" rel="ClassInfoEdit"><span>修改</span></a></li>
				<li class="line">line</li>
				<li><a class="icon" href="#"><span>导入EXCEL</span></a></li>
				<li><a class="icon" href="#"><span>导出EXCEL</span></a></li>
			</ul>
		</div>
		<table class="table" layouth="138">
			<thead>
				<tr>
					<th style="width:100px;">班级编号</th>
					<th style="width:100px;">班级名称</th>
					<th style="width:200px;">所属系部</th>
				</tr>
			</thead>
			<tbody>
			    <c:forEach items="${classInfos}" var="classInfo">
			        <tr target="classCode" rel="${classInfo.classCode}">
			          <td>${classInfo.classCode}</td>
			          <td>${classInfo.className}</td>
			          <td>${classInfo.deptInfo.deptName}</td>
			        </tr>
			    </c:forEach>
			</tbody>
		</table>
		<div class="panelBar">
			<div class="pages">
				<span>每页显示</span>
				<select name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
					<option value="10" ${param.numPerPage==10?"selected":""}>10</option>
					<option value="20" ${param.numPerPage==20?"selected":""}>20</option>
					<option value="30" ${param.numPerPage==30?"selected":""}>30</option>
					<option value="40" ${param.numPerPage==40?"selected":""}>40</option>
				</select>
				<span>条，共${totalCount}条</span>
			</div>
			<div class="pagination" targetType="navTab"  pageNumShown="4" totalCount="${totalCount}" numPerPage="${numPerPage}"  currentPage="${currentPage}"></div>
		</div>
	</div>
</div>
